﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Threading.Tasks;
using VOL.Entity.AttributeManager;
using VOL.Entity.DomainModels.PatientManage;
using VOL.SmartMecial.Dtos;
using VOL.SmartMecial.IServices.PayInfoManage;

namespace VOL.WebApi.Controllers.SmartMecial
{
    /// <summary>
    /// 缴费项目控制器
    /// 负责处理缴费项目相关的API请求
    /// </summary>
    [Route("api/PayItemController")]
    [PermissionTable(Name = "PayItemController")]
    public class PayItemController : ControllerBase
    {
        private readonly IPayItemService service;

        /// <summary>
        /// 构造函数，通过依赖注入获取缴费项目服务实例
        /// </summary>
        /// <param name="service">缴费项目服务</param>
        public PayItemController(IPayItemService service)
        {
            this.service = service;
        }
        /// <summary>
        /// 缴费明细列表
        /// </summary>
        /// <returns>缴费项目列表数据</returns>
        [HttpGet("GetPayItemList")]
        public List<PayItem> GetPayItemList()
        {
            return service.GetPayItemList();
        }
        
        /// <summary>
        /// 获取所有项目列表
        /// </summary>
        /// <returns>所有缴费项目数据</returns>
        [HttpGet("GetAllItem")]
        public List<PayItem> GetAllItem()
        {
            return service.GetPayItemList();
        }
    }
}
